package com.fangshicai.pro_test_03;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class MessageActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_message);
        TextView tvMessage = findViewById(R.id.message);
        Intent intent =getIntent();

        String stringExtra = intent.getStringExtra(MainActivity.MESSAGE_STRING);

        if(stringExtra != null){
            if(tvMessage != null){
                tvMessage.setText(stringExtra+"_MessageActivity");
            }
            else {
                Log.d("MessageActivity","tvMessage为空");
            }
        }

    }
}
